﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace lgweb.common
{
    public class NeedValidatePage : BasePage
    {
        protected int _userId = 0;  //用户id
        protected Guid _userGuid = Guid.Empty;
        protected string _userName = string.Empty;
        protected new void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);
            _userId = SessionInfo.UserID;
            _userGuid = SessionInfo.UserGUID;
            _userName = SessionInfo.UserName;
            if (_userId <= 0 || string.IsNullOrEmpty(_userName))
            {
                string strBackPath = Request.Url.AbsolutePath; //MethodStaticHandler.GetHqewIBSSite() + Request.ServerVariables["Path_Info"].ToString();
                if (Request.ServerVariables["QUERY_STRING"].ToString() != "")
                {
                    strBackPath += "?" + Request.ServerVariables["QUERY_STRING"].ToString();
                }
                Response.Write("<script>window.location.href=\"/login.aspx?backpathurl=" + Server.UrlEncode(strBackPath) + "\";</script>");
                //Response.Write("<script>window.location.href=\"/ibs/login.aspx?backpathurl=" + Server.UrlEncode(strBackPath) + "\";</script>");//本项目登录url
                Response.End();
            }
            //this.SessionInfo.

        }
    }
}